package com.example.smartcity.ui.dashboard;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ListView;

import com.example.smartcity.R;
import com.example.smartcity.ui.Adapter.SubMitListViewAdapter;
import com.example.smartcity.ui.Bean.submitBean;

import java.util.ArrayList;

public class SubmitOrder extends AppCompatActivity {

    private android.widget.ListView listView;
    private Button Submit;
    String title[] = {"姓名","手机号码","上车地点","下车地点"};
    String message[] = new String[title.length];
    ArrayList<submitBean> arrayList = new ArrayList<>();
    String end = null;
    String start = null;
    String userName =null;
    String userPhone = null;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_submit_order);
        listView = (ListView) findViewById(R.id.ListView);
        Submit = (Button) findViewById(R.id.Submit);
        initView();
    }
    public void setBack(View view){
        this.finish();
    }
    public void initView(){
        Intent intent = getIntent();
        message[0] = intent.getStringExtra("userName");
        message[1] = intent.getStringExtra("userPhone");
        message[2] = intent.getStringExtra("start");
        message[3] = intent.getStringExtra("end");
        for (int i = 0; i < title.length; i++) {
            submitBean bean = new submitBean(title[i],message[i]);
            arrayList.add(bean);
        }
        listView.setAdapter(new SubMitListViewAdapter(getBaseContext(),R.layout.submititemlayout,arrayList));
    }
}